DROP TABLE IF EXISTS `depts`;
CREATE TABLE "depts" (
  "deptId" bigint(26) NOT NULL AUTO_INCREMENT COMMENT '主键Id',
  "deptName" varchar(26) NOT NULL,
  "deptManager" varchar(26) DEFAULT NULL,
  PRIMARY KEY ("deptId")
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_german2_ci;

BEGIN;
INSERT INTO `depts` VALUES (1, 'IT部门', '罗平');
INSERT INTO `depts` VALUES (2, '财务部', '张三');
INSERT INTO `depts` VALUES (3, '行政部', '李四');
COMMIT;


CREATE TABLE "users" (
  "id" bigint(26) NOT NULL AUTO_INCREMENT COMMENT '主键Id',
  "version" int(11) NOT NULL DEFAULT '1' COMMENT '版本号-乐观锁 用',
  "code" varchar(26)  DEFAULT '*' COMMENT '用户编码',
  "mobile" varchar(26)  DEFAULT NULL COMMENT '手机号',
  "name" varchar(26)   DEFAULT '*' COMMENT '姓名',
  "password" varchar(26)  DEFAULT '000000' COMMENT '密码',
  "is_admin" char(1)  DEFAULT '0' COMMENT '是否管理员',
  "sex" varchar(4)  DEFAULT '男' COMMENT '性别',
  "dept_id" varchar(26)  DEFAULT '*' COMMENT '部门Id',
  "login_count" int(11) DEFAULT '0' COMMENT '登陆次数',
  "last_date" datetime DEFAULT NULL COMMENT '最后登陆时间',
  "amount" decimal(18,6) DEFAULT '0.000000' COMMENT '余额',
  "age" int(11) DEFAULT '0' COMMENT '年龄',
  "sort" int(11) DEFAULT '0' COMMENT '排序',
  "remark" varchar(250)  DEFAULT NULL COMMENT '备注',
  "create_user" varchar(26)  DEFAULT '*' COMMENT '创建人',
  "update_user" varchar(26)  DEFAULT '*' COMMENT '修改人',

  PRIMARY KEY ("id") USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8;

BEGIN;
INSERT INTO `users` VALUES (1, 207, '111222', '18058168811', '开发者', '000000', '1', '男', '1', 12, '2019-03-28 01:41:00', 0.000000, 0, 9, '11', '*', '*');
INSERT INTO `users` VALUES (2, 23, '00094', '18058168822', '测试员', '000000', '1', '男', '1', 66, '2019-03-15 12:29:00', 0.000000, 0, 2, '555', '*', '*');
INSERT INTO `users` VALUES (3, 22, '00384', '18058168833', '管理员', '000000', '1', '男', '2', 1, '2019-03-29 03:01:00', 0.000000, 0, 1, '0', '*', '*');
COMMIT;

DROP TABLE IF EXISTS `salary`;
CREATE TABLE "salary" (
  "userId" bigint(26) NOT NULL COMMENT '用户Id',
  "deptId" bigint(26) NOT NULL COMMENT '部门Id',
  "amount" decimal(18,2) DEFAULT '0.00' COMMENT '管理津贴',
  "createUser" varchar(26) DEFAULT '*' COMMENT '创建人',
  "updateUser" varchar(26) DEFAULT '*' COMMENT '修改人',
  PRIMARY KEY ("deptId","userId")
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

BEGIN;
INSERT INTO `salary` VALUES (1, 1, 11.00, '*', '*');
INSERT INTO `salary` VALUES (1, 2, 22.00, '*', '*');
INSERT INTO `salary` VALUES (1, 3, 33.00, '*', '*');
COMMIT;